package com.vanka.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.vanka.entity.account.User;
import com.vanka.mapper.account.UserMapper;
import com.vanka.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author VanKa qq:2395073039
 * @date 2021/6/28 10:11
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
    @Override
    public User getOneData(QueryWrapper<User> queryWrapper) {
        List<User> list = list(queryWrapper);
        if (list.size() == 1) {
            return list.get(0);
        } else {
            return null;
        }
    }
}
